<br>
<table align="center" cellspacing="2" cellpadding="2" border="0">
<tr>
    <td colspan="2" align="center">
	<h1>A model with 4 levels of nested random effects</h1>
		<br><br>
	</td>
</tr>

<tr>
    <td width="30%">
	<table width="90%" border="0" cellspacing="0" cellpadding="2" bgcolor="#359163">
         <tr>
           <td align="center">
             <font face="Arial, Helvetica" color="White"><b>ADMB Files</b></font>
           </td>
         </tr>
         <tr>
           <td>
             <table cellspacing=0 cellpadding=3 width="100%" border=0 bgcolor="#ffffff">
               <tr>
			     <td>
                     Code: <a href="nested4.tpl">nested4.tpl</a><br>
                     Data: 		<a href="nested4.dat">nested4.dat</a><br>
                     Initial values: <a href="nested4.pin">nested4.pin</a><br>
<!--
                     All required files (DOS): <a href="nested4.zip">nested4.zip</a><br>
					 All required files (linux): <a href="nested4.tar.gz">nested4.tar.gz</a><br>					 
-->
                     Expected Results: <a href="nested4-expected-results.par">nested4.par</a><br>
				   </font>
                 </td>
               </tr>
             </table>
           </td>
         </tr>
       </table>
<!--
<br>

	<table width="90%" border="0" cellspacing="0" cellpadding="2" bgcolor="#359163">
         <tr>
           <td align="center">
             <font face="Arial, Helvetica" color="White"><b>Running ADMB-executables</b></font>
           </td>
         </tr>
         <tr>
           <td>
             <table cellspacing=0 cellpadding=3 width="100%" border=0 bgcolor="#ffffff">
               <tr>
			     <td>
                     In a <a href="../admb_tutorial.html">DOS</a> window<br> 
					 Under <a href="../admb_tutorial.html">linux</a><br>
				   </font>
                 </td>
               </tr>
             </table>
           </td>
         </tr>
       </table>
<br>


	      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0>
        <TR>
          <TD align=middle><FONT face="Arial, Helvetica" 
            color=white><B>Navigation</B></FONT> </TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff 
            border=0>
              <TBODY>
              <TR>
                <TD>			  
				<A href="http://otter-rsch.com/admbre/admbre.html">ADMB-RE home</A> <br>
                <A href="http://otter-rsch.com/">Otter Research</A> 
        </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0></TABLE>

<br>
-->
	   
	</td>

	
 <td width="75%">
<h3><strong>Model description</strong></h3>
An example of a linear regression model with nested random effects (2 levels) is:
<br>
<div align="center">
	<em>y<sub>ijs</sub></em> 
	= 
	<em>u<sub>i</sub></em> + <em>u<sub>ij</sub></em> + <em>e<sub>ijs</sub></em>,
</div>
where <em>u<sub>i</sub></em> and <em>u<sub>ij</sub></em> are the random effects.
<br>
<br>
In the current example the models is a logistic regression with 4 levels of nesting, i.e. 
the random effects part looks like:
<div align="center">
	<em>u<sub>i</sub></em> + <em>u<sub>ij</sub></em> + <em>u<sub>ijk</sub></em> + <em>u<sub>ijkl</sub></em>
</div>
To effiently implement this model in ADMB-RE one must make use of the <TT>SEPARABLE_FUNCTION</TT> keyword. 
In this particular example <em>i=1,...,100</em>, <em>j=1,2</em>, <em>k=1,2</em> and <em>l=1,2</em>.
So by calling the <TT>SEPARABLE_FUNCTION</TT> for each value of <em>i</em>, one in effect breaks up the computation
into 100 smaller computations, which helps ADMB-RE avoid dealing with large matrices (800x800 in this case).

<h3><strong>Results</strong></h3>
It takes about 1-2 minutes to fit the model.

</table>

